<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/* 客户服务器管理后台，前缀：manager */
Route::get('/home', 'Manager\HomeController@home')->name('home');

Route::get('/server/choose', 'Manager\HomeController@choose')->name('server.choose');
Route::resource('server', 'Manager\ServerController');
Route::post('server/list', 'Manager\ServerController@serverList');
Route::post('server/renew', 'Manager\ServerController@serverRenew');
Route::post('server/exchangeTime', 'Manager\ServerController@serverExchangeTime');
Route::get('machine/{server}/add', 'Manager\MachineController@add')->name('machine.add');
Route::get('machine/{server}/show', 'Manager\MachineController@show')->name('machine.show');

//Route::resource('server_v2', 'Manager\ServerV2Controller');
Route::get('server_v2/create', 'Manager\ServerV2Controller@create')->name('server_v2.create');
Route::get('server_v2/create2', 'Manager\ServerV2Controller@create2')->name('server_v2.create2');
Route::post('server_v2/store', 'Manager\ServerV2Controller@store')->name('server_v2.store');
Route::post('server_v2/store2', 'Manager\ServerV2Controller@store2')->name('server_v2.store2');

Route::get('server_v2/{server}', 'Manager\ServerV2Controller@show')->name('server_v2.show');
Route::post('server_v2/{server}/ajaxRunSQL', 'Manager\ServerV2Controller@ajaxRunSQL');
Route::post('server_v2/{server}/ajaxServerInfo', 'Manager\ServerV2Controller@ajaxServerInfo');
Route::post('server_v2/{server}/ajaxServerTest', 'Manager\ServerV2Controller@ajaxServerTest');
Route::post('server_v2/{server}/ajaxInstallInfo', 'Manager\ServerV2Controller@ajaxInstallInfo');
Route::post('server_v2/{server}/ajaxSaveServer', 'Manager\ServerV2Controller@ajaxSaveServer');
Route::post('server_v2/{server}/ajaxInstallNew', 'Manager\ServerV2Controller@ajaxInstallNew');
Route::post('server_v2/{server}/ajaxServerUpdate', 'Manager\ServerV2Controller@ajaxServerUpdate');
Route::post('server_v2/{server}/ajaxServerPull', 'Manager\ServerV2Controller@ajaxServerPull');
Route::post('server_v2/{server}/ajaxGetBT', 'Manager\ServerV2Controller@ajaxGetBT');
Route::post('server_v2/{server}/ajaxSaveBT', 'Manager\ServerV2Controller@ajaxSaveBT');
Route::post('server_v2/{server}/ajaxCheckBT', 'Manager\ServerV2Controller@ajaxCheckBT');
Route::post('server_v2/{server}/ajaxTelnet', 'Manager\ServerV2Controller@ajaxTelnet');
Route::post('server_v2/{server}/ajaxCheckBTAPI', 'Manager\ServerV2Controller@ajaxCheckBTAPI');
Route::post('server_v2/{server}/ajaxServerStatus', 'Manager\ServerV2Controller@ajaxServerStatus');
Route::post('server_v2/{server}/ajaxServerStart', 'Manager\ServerV2Controller@ajaxServerStart');
Route::post('server_v2/{server}/ajaxServerStop', 'Manager\ServerV2Controller@ajaxServerStop');

Route::Group(['prefix'=>'gameEditor/{server}'],function (){
    Route::get('index', 'Manager\GameEditorController@index')->name('server.editor');
    Route::post('itemList', 'Manager\GameEditorController@itemList');
    Route::post('itemSave', 'Manager\GameEditorController@itemSave');
    Route::post('creatureList', 'Manager\GameEditorController@creatureList');
    Route::post('accountList', 'Manager\GameEditorController@accountList');
    Route::post('accountDoAct', 'Manager\GameEditorController@accountDoAct');
    Route::post('isAgentChange', 'Manager\GameEditorController@isAgentChange');
    Route::post('characterList', 'Manager\GameEditorController@characterList');
    Route::post('characterDoAct', 'Manager\GameEditorController@characterDoAct');
    Route::post('clearDatabase', 'Manager\GameEditorController@clearDatabase');
});

Route::Group(['prefix'=>'ad'],function () {
    Route::get('', 'Manager\AdController@index');
    Route::post('list', 'Manager\AdController@list');
    Route::post('add', 'Manager\AdController@add');
    Route::post('del', 'Manager\AdController@del');
    Route::post('plist', 'Manager\AdController@plist');
    Route::post('save', 'Manager\AdController@save');
    Route::post('getLog', 'Manager\AdController@getLog');
    Route::post('getClickInfo', 'Manager\AdController@getClickInfo');
});

Route::Group(['prefix'=>'serverEngine'],function () {
    Route::get('', 'Manager\ServerEngineController@index');
    Route::post('list', 'Manager\ServerEngineController@list');
    Route::post('getAuthList', 'Manager\ServerEngineController@getAuthList');
    Route::post('updateEndTime', 'Manager\ServerEngineController@updateEndTime');

});
Route::Group(['prefix'=>'serverAuth'],function () {
    Route::get('', 'Manager\ServerAuthController@index');
    Route::post('list', 'Manager\ServerAuthController@list');
    Route::post('add', 'Manager\ServerAuthController@add');
    Route::post('del', 'Manager\ServerAuthController@del');
    Route::post('save', 'Manager\ServerAuthController@save');
    Route::post('addtime', 'Manager\ServerAuthController@addtime');
});

Route::Group(['prefix'=>'authSingle'],function () {
    Route::get('', 'Manager\AuthSingleController@index');
    Route::post('list', 'Manager\AuthSingleController@list');
    Route::post('add', 'Manager\AuthSingleController@add');
    Route::post('del', 'Manager\AuthSingleController@del');
    Route::post('save', 'Manager\AuthSingleController@save');
    Route::post('addtime', 'Manager\AuthSingleController@addtime');
    Route::post('clearIP', 'Manager\AuthSingleController@clearIP');
});

Route::Group(['prefix'=>'server/api/{server}'],function () {
    Route::get('', 'Manager\ApiController@index');
    Route::post('info', 'Manager\ApiController@info');
    Route::post('getRandKey', 'Manager\ApiController@getRandKey');
    Route::post('saveConfig', 'Manager\ApiController@saveConfig');
    Route::post('getLogList', 'Manager\ApiController@getLogList');
});

Route::Group(['prefix'=>'server/cooperation/{server}'],function () {
    Route::get('', 'Manager\CooperationController@index');
    Route::post('info', 'Manager\CooperationController@info');
    Route::post('saveConfig', 'Manager\CooperationController@saveConfig');
});


Route::post('server/mallspell/getSpellInfo', 'Manager\MallSpellController@getSpellInfo');
// Route::get('server/mallspell/{server}', 'Manager\MallSpellController@index');
Route::Group(['prefix'=>'server/mallspell/{server}'],function (){
    Route::get('', 'Manager\MallSpellController@index');
    Route::post('info', 'Manager\MallSpellController@info');
    Route::post('save', 'Manager\MallSpellController@save');
    Route::post('saveConfig', 'Manager\MallSpellController@saveConfig');


//    Route::post('creatureList', 'Manager\MallSpellController@creatureList');
//    Route::post('accountList', 'Manager\MallSpellController@accountList');
//    Route::post('accountDoAct', 'Manager\MallSpellController@accountDoAct');
//    Route::post('characterList', 'Manager\MallSpellController@characterList');
//    Route::post('characterDoAct', 'Manager\MallSpellController@characterDoAct');
});

Route::post('server/{server}/command', 'Manager\ServerController@command')->name('server.command');
Route::get('server/{server}/mall', 'Manager\ServerController@mall')->name('server.mall');
Route::get('server/mallspell/{server}', 'Manager\MallSpellController@index')->name('server.mallspell');
Route::get('server/{server}/status', 'Manager\ServerController@status')->name('server.status');
Route::post('server/{server}/status/bt', 'Manager\ServerController@statusBt');
Route::post('server/{server}/status/ssh', 'Manager\ServerController@statusSSH');
Route::post('server/{server}/status/db', 'Manager\ServerController@statusDB');
Route::post('server/{server}/status/soap', 'Manager\ServerController@statusSOAP');
Route::post('server/{server}/status/getVersion', 'Manager\ServerController@getVersion');
Route::post('server/{server}/status/getMotd', 'Manager\ServerController@getMotd');
Route::post('server/{server}/status/setMotd', 'Manager\ServerController@setMotd');
Route::post('server/{server}/status/resetPwd', 'Manager\ServerController@resetPwd');

Route::post('server/{server}/goodsSearch', 'Manager\ServerController@goodsSearch');
Route::post('server/{server}/goodsAdd', 'Manager\ServerController@goodsAdd');
Route::post('server/{server}/goodsList', 'Manager\ServerController@goodsList');
Route::post('server/{server}/goodsCatList', 'Manager\ServerController@goodsCatList');
Route::post('server/{server}/goodsCatAdd', 'Manager\ServerController@goodsCatAdd');
Route::post('server/{server}/goodsCatUpdate', 'Manager\ServerController@goodsCatUpdate');
Route::post('server/{server}/goodsCatDel', 'Manager\ServerController@goodsCatDel');
Route::post('server/{server}/goodsUpdate', 'Manager\ServerController@goodsUpdate');
Route::post('server/{server}/goodsRemove', 'Manager\ServerController@goodsRemove');
Route::get('server/{server}/config', 'Manager\ServerController@config')->name('server.config');
//Route::get('server_v2/{server}/config', 'Manager\ServerV2Controller@config')->name('server_v2.config');
Route::post('server/{server}/configBase', 'Manager\ServerController@configBase');
Route::post('server/{server}/configBaseUpdate', 'Manager\ServerController@configBaseUpdate');

Route::get('server/{server}/lua', 'Manager\ServerController@lua')->name('server.lua');
Route::post('server/{server}/luaList', 'Manager\ServerController@luaList');
Route::post('server/{server}/luaAdd', 'Manager\ServerController@luaAdd');
Route::post('server/{server}/luaDel', 'Manager\ServerController@luaDel');
Route::post('server/{server}/luaStatus', 'Manager\ServerController@luaStatus');
Route::post('server/{server}/luaScript', 'Manager\ServerController@luaScript');
Route::post('server/{server}/luaUpdate', 'Manager\ServerController@luaUpdate');
Route::post('server/{server}/luaReload', 'Manager\ServerController@luaReload');
Route::post('server/{server}/luaRename', 'Manager\ServerController@luaRename');

Route::get('server/{server}/video', 'Manager\VideoController@video')->name('server.video');
Route::post('server/{server}/videoList', 'Manager\VideoController@videoList');
Route::post('server/{server}/videoAdd', 'Manager\VideoController@videoAdd');
Route::post('server/{server}/videoDel', 'Manager\VideoController@videoDel');
Route::post('server/{server}/videoUpdate', 'Manager\VideoController@videoUpdate');

Route::post('server/config/getWorldServerConf', 'Manager\ServerController@getWorldServerConf');
Route::post('server/config/saveWorldServerConf', 'Manager\ServerController@saveWorldServerConf');
Route::post('server/config/runGMCommand', 'Manager\ServerController@runGMCommand');
Route::post('server/config/launcherOn', 'Manager\ServerController@launcherOn');
Route::post('server/config/getLauncherConfig', 'Manager\ServerController@getLauncherConfig');
Route::post('server/config/launcherConfigSave', 'Manager\ServerController@launcherConfigSave');

Route::get('server/{server}/gm', 'Manager\ServerController@gm')->name('server.gm');


Route::get('buyServer/{server_id}','Manager\PayController@buyServer'); //购买服务端页面
Route::get('buyServerDo','Manager\PayController@buyServerDo'); //支付请求

Route::post('ajaxBuyServer','Manager\PayController@ajaxBuyServer'); //积分购买服务

Route::any('profit','Manager\PayController@profit'); //积分记录
Route::get('withdraw','Manager\PayController@withdraw'); //提现
Route::post('withdrawDo','Manager\PayController@withdrawDo'); //提现动作
Route::post('alipaySave','Manager\PayController@alipaySave'); //更新支付宝

Route::get('recharge','Manager\PayController@recharge');
Route::post('rechargeDo','Manager\PayController@rechargeDo');

Route::Group(['prefix'=>'modConf'],function (){
    Route::post('list/{server_id}','Manager\ModConfController@list');
    Route::post('add/{server_id}','Manager\ModConfController@add');
    Route::post('addAuto/{server_id}','Manager\ModConfController@addAuto');
    Route::post('conf/{server_id}','Manager\ModConfController@conf');
    Route::post('confSave/{server_id}/{modConf_id}','Manager\ModConfController@confSave');
    Route::post('del/{server_id}/{modConf_id}','Manager\ModConfController@del');
    Route::get('{server_id}','Manager\ModConfController@index');
});

Route::get('recommend','Manager\RecommendController@index');
